# Copyright(c) 2008 Tri Tech Information Systems Inc. 
# Distributed under the Boost Software License, Version 1.0.
#     (See accompanying file ../../LICENSE_1_0.txt or copy at
#           http://www.boost.org/LICENSE_1_0.txt)
#     
from abctest import *

def something_test():
    """
    >>> x = ISomething()
    >>> x.action([4, 5, 6])
    15
    >>> actor(x)
    10
    """

class Sub(ISomething):
    def action(self, values):
        factor = 1
        for item in values:
            factor *= item
        return factor

def sub_test():
    """
    >>> x = Sub()
    >>> x.action([4, 5, 6])
    120
    >>> actor(x)
    24
    """

class Sub2(ISomething):
    def action(self, values):
        factor = 1
        for key, value in values.items():
            factor *= value
        return factor

def something2_test():
    """
    >>> x = ISomething()
    >>> x.action({'a' : 4, 'b' : 5, 'c' : 6 })
    15
    >>> actor2(x)
    10
    """

def sub2_test():
    """
    >>> x = Sub2()
    >>> x.action({'a' : 4, 'b' : 5, 'c' : 6 })
    120
    >>> actor2(x)
    24
    """


def test_something():
    """
    >>> x = Sub()
    >>> x.crazy([(1,2), (3,4)])
    """

if __name__ == '__main__':
    import doctest
    import sys
    sys.exit(doctest.testmod(optionflags = doctest.ELLIPSIS)[0])

